
const taskInstances = new Map<any, any>()

export function getTaskInstance(taskConstructor) {
  let ins = taskInstances.get(taskConstructor)
  if (!ins) {
    ins = new taskConstructor()
    taskInstances.set(taskConstructor, ins)
  }
  return ins
}
